DEMO: A loop lets us repeat a set of commands without having to type them over and over.

A for loop lets us set a range. The range is the number of times that the set of commands will repeat.

  • Follow the directions on stage to learn about each part of a for loop.
  • After clicking, scroll over the code on the stage to see the different parts of a for loop.
  • When you're finished click Submit and Next to continue.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)